<template>
  <van-cell class="articleItem" :to="`/article/${article.art_id}`">
    <div class="title van-multi-ellipsis--l2" slot="title">{{article.title}}</div>
    <div slot="label" class="label">
      <div class="img-item" v-if="article.cover.type===3">
        <div class="imgList" v-for="(item, index) in article.cover.images" :key="index">
          <van-image fit="cover" :src="item" class="img-cover" />
        </div>
      </div>
      <div class="label-info-wrap">
        <span>{{article.aut_name}}</span>
        <span>{{article.comm_count}}评论</span>
        <span>{{article.pubdate | relativeTime}}</span>
      </div>
    </div>
      <van-image :src="article.cover.images[0]" class="right-cover" slot="default" v-if="article.cover.type===1" fit="cover"/>
  </van-cell>
</template>

<script>
export default {
  data() {
    return {}
  },
  created() {},
  mounted() {},
  props: {
    article: {
      type: Object,
      required: true
    }
  },
  methods: {}
}
</script>

<style scoped lang="less">
.articleItem {
  .title {
    font-size: 32px;
    color: #3a3a3a;
  }
  .label {
    padding: 30px 0;
    font-size: 28px;
    color: #bfbfbf;
    .label-info-wrap span {
      margin-right: 25px;
    }
    .img-item {
      display: flex;
      padding: 24px 0;
      .imgList {
        flex: 1;
        height: 146px;
        &:not(:last-child) {
          padding-right: 4px;
        }
        .img-cover {
          width: 100%;
          height: 146px;
        }
      }
    }
  }
  .van-cell__value {
    flex: unset;
    width: 232px;
    height: 146px;
    margin-left: 25px;
    .right-cover {
      width: 100%;
      height: 146px;
    }
  }
}
</style>
